﻿namespace Stickam_Client
{
    [DesignerGenerated]
    public __gc class Form_ExecuteStatement : public Form
    {
        // Methods
        public: Form_ExecuteStatement()
        {
            this->InitializeComponent();
        }

        private: void __gc* Clear_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->ScriptCode->Clear();
        }

        [DebuggerNonUserCode]
        protected: override void __gc* Dispose(Boolean __gc* disposing)
        {
            try
            {
                if (disposing && (this->components != 0))
                {
                    this->components->Dispose();
                }
            }
            finally
            {
                base->Dispose(disposing);
            }
        }

        private: void __gc* Execute_Click(Object __gc* sender, EventArgs __gc* e)
        {
            if (this->CheckBox1->Checked)
            {
                this->FormParent->ExecuteServerScript(this->ScriptCode->Text);
            }
            else
            {
                this->FormParent->ExecuteScript(this->ScriptCode->Text);
            }
        }

        private: void __gc* FileList_SelectedValueChanged(Object __gc* sender, EventArgs __gc* e)
        {
            if (this->CanLoad)
            {
                this->FilePath->Text = Conversions::ToString(Operators::AddObject(String::Concat(this->FormParent->MyVars->currentDirectory, S"Scripts\\"), this->FileList->SelectedValue));
                this->ScriptCode->Text = Globals::LoadFile(this->FilePath->Text);
            }
            if (!this->CanLoad)
            {
                this->CanLoad = true;
            }
        }

        [DebuggerStepThrough]
        private: void __gc* InitializeComponent()
        {
            ComponentResourceManager __gc* manager = __gc new ComponentResourceManager(__typeof(Form_ExecuteStatement));
            this->ScriptCode = __gc new TextBox();
            this->Execute = __gc new Button();
            this->Clear = __gc new Button();
            this->OpenLoader = __gc new Button();
            this->FileList = __gc new ComboBox();
            this->RefreshList = __gc new Button();
            this->FilePath = __gc new TextBox();
            this->LoadFromFile = __gc new Button();
            this->CheckBox1 = __gc new CheckBox();
            this->SuspendLayout();
            this->ScriptCode->AcceptsTab = true;
            this->ScriptCode->Font = __gc new Font(S"Courier New", 9, FontStyle::Regular, GraphicsUnit::Point, 0);
            Point __gc* point = (1, 1);
            this->ScriptCode->Location = point;
            this->ScriptCode->Multiline = true;
            this->ScriptCode->Name = S"ScriptCode";
            this->ScriptCode->ScrollBars = ScrollBars::Vertical;
            Size __gc* size = (0x165, 0xcf);
            this->ScriptCode->Size = size;
            this->ScriptCode->TabIndex = 0;
            this->ScriptCode->WordWrap = false;
            this->Execute->FlatStyle = FlatStyle::Popup;
            this->Execute->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (1, 0xd1);
            this->Execute->Location = point;
            this->Execute->Name = S"Execute";
            size = (0xef, 0x12);
            this->Execute->Size = size;
            this->Execute->TabIndex = 1;
            this->Execute->Text = S"EXECUTE";
            this->Execute->UseCompatibleTextRendering = true;
            this->Execute->UseVisualStyleBackColor = true;
            this->Clear->FlatStyle = FlatStyle::Popup;
            this->Clear->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x101, 0xd1);
            this->Clear->Location = point;
            this->Clear->Name = S"Clear";
            size = (50, 0x12);
            this->Clear->Size = size;
            this->Clear->TabIndex = 2;
            this->Clear->Text = S"CLEAR";
            this->Clear->UseCompatibleTextRendering = true;
            this->Clear->UseVisualStyleBackColor = true;
            this->OpenLoader->FlatStyle = FlatStyle::Popup;
            this->OpenLoader->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x134, 0xd1);
            this->OpenLoader->Location = point;
            this->OpenLoader->Name = S"OpenLoader";
            size = (50, 0x12);
            this->OpenLoader->Size = size;
            this->OpenLoader->TabIndex = 6;
            this->OpenLoader->Text = S"OPEN  >";
            this->OpenLoader->UseCompatibleTextRendering = true;
            this->OpenLoader->UseVisualStyleBackColor = true;
            this->FileList->DropDownStyle = ComboBoxStyle::Simple;
            this->FileList->DropDownWidth = 0x90;
            this->FileList->FormattingEnabled = true;
            this->FileList->IntegralHeight = false;
            point = (0x167, 1);
            this->FileList->Location = point;
            this->FileList->Name = S"FileList";
            size = (0x90, 0xba);
            this->FileList->Size = size;
            this->FileList->TabIndex = 7;
            this->RefreshList->FlatStyle = FlatStyle::Popup;
            this->RefreshList->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x167, 0xbc);
            this->RefreshList->Location = point;
            this->RefreshList->Name = S"RefreshList";
            size = (140, 0x12);
            this->RefreshList->Size = size;
            this->RefreshList->TabIndex = 8;
            this->RefreshList->Text = S"REFRESH";
            this->RefreshList->UseCompatibleTextRendering = true;
            this->RefreshList->UseVisualStyleBackColor = true;
            point = (0x167, 0xcf);
            this->FilePath->Location = point;
            this->FilePath->Name = S"FilePath";
            size = (0x63, 20);
            this->FilePath->Size = size;
            this->FilePath->TabIndex = 9;
            this->LoadFromFile->FlatStyle = FlatStyle::Popup;
            this->LoadFromFile->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x1cb, 0xcf);
            this->LoadFromFile->Location = point;
            this->LoadFromFile->Name = S"LoadFromFile";
            size = (40, 20);
            this->LoadFromFile->Size = size;
            this->LoadFromFile->TabIndex = 10;
            this->LoadFromFile->Text = S"LOAD";
            this->LoadFromFile->UseCompatibleTextRendering = true;
            this->LoadFromFile->UseVisualStyleBackColor = true;
            this->CheckBox1->AutoSize = true;
            point = (0xf2, 0xd3);
            this->CheckBox1->Location = point;
            this->CheckBox1->Name = S"CheckBox1";
            size = (15, 14);
            this->CheckBox1->Size = size;
            this->CheckBox1->TabIndex = 11;
            this->CheckBox1->UseVisualStyleBackColor = true;
            SizeF __gc* ef = (6, 13);
            this->AutoScaleDimensions = ef;
            this->AutoScaleMode = AutoScaleMode::Font;
            size = (0x167, 0xe4);
            this->ClientSize = size;
            this->Controls->Add(this->CheckBox1);
            this->Controls->Add(this->LoadFromFile);
            this->Controls->Add(this->FilePath);
            this->Controls->Add(this->RefreshList);
            this->Controls->Add(this->FileList);
            this->Controls->Add(this->OpenLoader);
            this->Controls->Add(this->Clear);
            this->Controls->Add(this->Execute);
            this->Controls->Add(this->ScriptCode);
            this->FormBorderStyle = FormBorderStyle::FixedToolWindow;
            this->Icon = *static_cast<__box Icon*>(manager->GetObject(S"$this.Icon"));
            this->Name = S"Form_ExecuteStatement";
            this->StartPosition = FormStartPosition::Manual;
            this->Text = S"Execute Script Statement";
            this->ResumeLayout(false);
            this->PerformLayout();
        }

        private: void __gc* LoadFromFile_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->OpenFile->Filter = S"Text (*.txt)|*.txt|JScript (*.js)|*.js";
            if (this->OpenFile->ShowDialog() == DialogResult::OK)
            {
                this->FilePath->Text = this->OpenFile->FileName;
                this->ScriptCode->Text = Globals::LoadFile(this->OpenFile->FileName);
            }
        }

        private: void __gc* OpenLoader_Click(Object __gc* sender, EventArgs __gc* e)
        {
            if (this->IsLoaderOpen)
            {
                this->Width -= 140;
                this->OpenLoader->Text = S"OPEN  >";
                this->IsLoaderOpen = false;
            }
            else
            {
                this->Width += 140;
                this->OpenLoader->Text = S"CLOSE<";
                this->IsLoaderOpen = true;
                this->RefreshList_Click(0, 0);
            }
        }

        private: void __gc* RefreshList_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->CanLoad = false;
            this->Files = Directory::GetFiles(String::Concat(this->FormParent->MyVars->currentDirectory, S"Scripts"));
            this->Scripts = __gc new ArrayList();
            foreach (String __gc* str in this->Files)
            {
                str = Strings::Mid(str, (str->LastIndexOf(S"\\") + 2));
                if ((Strings::InStr(str, S".txt", CompareMethod::Binary) != 0) | (Strings::InStr(str, S".js", CompareMethod::Binary) != 0))
                {
                    this->Scripts->Add(str);
                }
            }
            this->FileList->DataSource = this->Scripts;
        }


        // Properties
        [DebuggerNonUserCode]
        public private: __property virtual CheckBox __gc* get_CheckBox1()
        {
            return this->_CheckBox1;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_CheckBox1(CheckBox __gc* WithEventsValue)
        {
            this->_CheckBox1 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_Clear()
        {
            return this->_Clear;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Clear(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.Clear_Click);
            if (this->_Clear != 0)
            {
                this->_Clear->Click -= handler;
            }
            this->_Clear = WithEventsValue;
            if (this->_Clear != 0)
            {
                this->_Clear->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_Execute()
        {
            return this->_Execute;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Execute(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.Execute_Click);
            if (this->_Execute != 0)
            {
                this->_Execute->Click -= handler;
            }
            this->_Execute = WithEventsValue;
            if (this->_Execute != 0)
            {
                this->_Execute->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual ComboBox __gc* get_FileList()
        {
            return this->_FileList;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_FileList(ComboBox __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.FileList_SelectedValueChanged);
            if (this->_FileList != 0)
            {
                this->_FileList->SelectedValueChanged -= handler;
            }
            this->_FileList = WithEventsValue;
            if (this->_FileList != 0)
            {
                this->_FileList->SelectedValueChanged += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual TextBox __gc* get_FilePath()
        {
            return this->_FilePath;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_FilePath(TextBox __gc* WithEventsValue)
        {
            this->_FilePath = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_LoadFromFile()
        {
            return this->_LoadFromFile;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_LoadFromFile(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.LoadFromFile_Click);
            if (this->_LoadFromFile != 0)
            {
                this->_LoadFromFile->Click -= handler;
            }
            this->_LoadFromFile = WithEventsValue;
            if (this->_LoadFromFile != 0)
            {
                this->_LoadFromFile->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_OpenLoader()
        {
            return this->_OpenLoader;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_OpenLoader(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.OpenLoader_Click);
            if (this->_OpenLoader != 0)
            {
                this->_OpenLoader->Click -= handler;
            }
            this->_OpenLoader = WithEventsValue;
            if (this->_OpenLoader != 0)
            {
                this->_OpenLoader->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_RefreshList()
        {
            return this->_RefreshList;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_RefreshList(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.RefreshList_Click);
            if (this->_RefreshList != 0)
            {
                this->_RefreshList->Click -= handler;
            }
            this->_RefreshList = WithEventsValue;
            if (this->_RefreshList != 0)
            {
                this->_RefreshList->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual TextBox __gc* get_ScriptCode()
        {
            return this->_ScriptCode;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_ScriptCode(TextBox __gc* WithEventsValue)
        {
            this->_ScriptCode = WithEventsValue;
        }


        // Fields
        [AccessedThroughProperty(S"CheckBox1")]
        private: CheckBox __gc* _CheckBox1;
        [AccessedThroughProperty(S"Clear")]
        private: Button __gc* _Clear;
        [AccessedThroughProperty(S"Execute")]
        private: Button __gc* _Execute;
        [AccessedThroughProperty(S"FileList")]
        private: ComboBox __gc* _FileList;
        [AccessedThroughProperty(S"FilePath")]
        private: TextBox __gc* _FilePath;
        [AccessedThroughProperty(S"LoadFromFile")]
        private: Button __gc* _LoadFromFile;
        [AccessedThroughProperty(S"OpenLoader")]
        private: Button __gc* _OpenLoader;
        [AccessedThroughProperty(S"RefreshList")]
        private: Button __gc* _RefreshList;
        [AccessedThroughProperty(S"ScriptCode")]
        private: TextBox __gc* _ScriptCode;
        private: Boolean __gc* CanLoad = false;
        private: IContainer __gc* components;
        private: String __gc* Files __gc [];
        public: Form1 __gc* FormParent;
        public: Boolean __gc* IsLoaderOpen = false;
        private: OpenFileDialog __gc* OpenFile = __gc new OpenFileDialog();
        private: ArrayList __gc* Scripts = __gc new ArrayList();
    };
}

